package nl.Viewer.SerializedObjects;

import java.util.ArrayList;

/**
 * Client-side deserialization of a session
 * 
 * @author Jeroen Verschuur
 * 
 */

public class Session {

   public static enum Status {
      IDLE, QUEUED, WORKING, FAILED, CLOSED
   }

   public long           sessionId;

   public String         algorithm   = "";
   public int            progress    = 0;

   public ArrayList<Job> waitingJobs = new ArrayList<Job>();
   public Job            currentJob  = null;

   public Status         status      = Status.IDLE;

   public String         reason      = null;

   public ArrayList<Job> alteredJobs = new ArrayList<Job>();

   public String toString() {
      return "Session[" + sessionId + "/algorithm:" + algorithm + "(" + progress + "%)/waitingJobs:" + waitingJobs.size() + "/" + currentJob + "/" + status + "/altered: " + alteredJobs.size() + "]";

   }

}
